<template>
    <div>
        <h2>
            childone - 1  
        </h2>
        <p v-if="show" :style="{background:'red'}">
            props == {{id}} - {{count}} -- {{msg}}
        </p>
        <button @click="changeTwo">点击修改组件2</button>
        <p>
            <input type="checkbox" :checked="checked" @change="change"  >点击切换
        </p>
        <hr>
    </div>
</template>

<script>
export default {
    model:{
        prop:'checked',
        event:'change'
    },  
    data(){
        return {
            show:true  
        }
    },
    methods:{
        change(e){
            // $emit('change',$event.target.checked)
            console.log(e.target.checked)
            this.$emit("change",e.target.checked)
        },
        todoaction(){
            alert("Are you oK")
        },
        changeTwo(){
            this.$bus.$emit("changeTwoxxxx",10)
        }
    },
    props:{
        checked:Boolean,
        id:String,
        count:{
            type:Number,
            default:1000,
        },
        msg:[String,Object]
    }
}
</script>